#ifndef __SEARCHWORDWIDGET_H_
#define __SEARCHWORDWIDGET_H_

#include <ZWidget.h>
#include <ZLabel.h>
#include <ZScrollPanel.h>
#include <ZMultiLineEdit.h>
#include <ZText.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qpixmap.h>
#include <qevent.h>
#include <qtimer.h>
#include <qfont.h>

#include <cstdio>

#include "codec.h"
#include "kdict/kdic.h"
#include "key.h"
#include <PYDB.h>

#define OFFSET_STEP 100 
#define MEAN_HEIGHT 200	
#define MEAN_WIDTH	238
#define MEAN_Y		30
class searchWordWidget : public ZWidget
{
	Q_OBJECT
public:
	searchWordWidget(QWidget *parent);
	~searchWordWidget();
	virtual void paintEvent(QPaintEvent *e);
	virtual void keyPressEvent(QKeyEvent *e);
public slots:
    void timeDone();
    void clearEngStr();
	void addCurrentWord();
private:

    /* 字母输入法 */
	unsigned int engx,engy,oldx,oldy;
	unsigned int sensitivity;
	QTimer *engtimer;
	enum statue{engUp,engLow}sta;
	void imeOutput(QString str);
	QString tmpstr;

	/* 字典部件 */
	QString engStr,phoneticStr,meanStr;
	QPixmap p;
	QPixmap textPix;
	void openKdict();
	void updateMean();
	int vOffset;/* 显示字典的偏移 */
	int textHeight;
};

#endif /* __SEARCHWORDWIDGET_H_ */


